#ifndef _HCC_ERROR_CODE_DRV_PER_FLASH_H_
#define _HCC_ERROR_CODE_DRV_PER_FLASH_H_

#include "ofc_types.h"
#include "hcc_error_code.h"
#include "hcc_error_code_drv.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_DRV_PER_FLASH_ERROR(error_code) (int)HCC_MAKE_DRIVER_ERROR(kHccDrvPerFlash, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_DRIVER_ERROR(kHccDrvPerFlash, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * 外设Flash驱动:外设Flash驱动
 */
enum THccDrvPerFlashTag
{
	kHccDrvPerFlashSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kHccDrvPerFlashComm	=	HCC_MAKE_DRV_PER_FLASH_ERROR(0),			///<通讯错误
	kHccDrvPerFlashParam	=	HCC_MAKE_DRV_PER_FLASH_ERROR(1),			///<参数错误
	kHccDrvPerFlashCallBack	=	HCC_MAKE_DRV_PER_FLASH_ERROR(2),			///<回调函数未设置
	kHccDrvPerFlashExist	=	HCC_MAKE_DRV_PER_FLASH_ERROR(3),			///<芯片不存在
	kHccDrvPerFlashSupport	=	HCC_MAKE_DRV_PER_FLASH_ERROR(4),			///<不支持的芯片
	kHccDrvPerFlashPending	=	HCC_MAKE_DRV_PER_FLASH_ERROR(5),			///<写入/擦除进行中
	kHccDrvPerFlashFail	=	HCC_MAKE_DRV_PER_FLASH_ERROR(6),			///<写入/擦除失败
	kHccDrvPerFlashIdle	=	HCC_MAKE_DRV_PER_FLASH_ERROR(7),			///<当前不在写入/擦除中
	kHccDrvPerFlashTimeOut	=	HCC_MAKE_DRV_PER_FLASH_ERROR(8),			///<等待(读取/写入/擦除/服务)超时
	kHccDrvPerFlashUnlockFail	=	HCC_MAKE_DRV_PER_FLASH_ERROR(9),			///<保护区域解锁失败(可能是芯片的写保护引脚有效)
};
typedef enum THccDrvPerFlashTag THccDrvPerFlash;


typedef Int32 THccDrvPerFlashLine;
#define kHccDrvPerFlashSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kHccDrvPerFlashCommLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(0)	///<通讯错误
#define kHccDrvPerFlashParamLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(1)	///<参数错误
#define kHccDrvPerFlashCallBackLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(2)	///<回调函数未设置
#define kHccDrvPerFlashExistLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(3)	///<芯片不存在
#define kHccDrvPerFlashSupportLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(4)	///<不支持的芯片
#define kHccDrvPerFlashPendingLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(5)	///<写入/擦除进行中
#define kHccDrvPerFlashFailLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(6)	///<写入/擦除失败
#define kHccDrvPerFlashIdleLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(7)	///<当前不在写入/擦除中
#define kHccDrvPerFlashTimeOutLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(8)	///<等待(读取/写入/擦除/服务)超时
#define kHccDrvPerFlashUnlockFailLine	HCC_MAKE_DRV_PER_FLASH_ERROR_LINE(9)	///<保护区域解锁失败(可能是芯片的写保护引脚有效)

//旧版本适配补丁
typedef THccDrvPerFlash TPerFlashErrorCode;
typedef THccDrvPerFlash TPerFlashNandErrorCode;

#define kPerFlashErrorCodeSuccess kHccDrvPerFlashSuccess
#define kPerFlashErrorCodeComm kHccDrvPerFlashComm
#define kPerFlashErrorCodeParam kHccDrvPerFlashParam
#define kPerFlashErrorCodeCallBack kHccDrvPerFlashCallBack
#define kPerFlashErrorCodeExist kHccDrvPerFlashExist
#define kPerFlashErrorCodeSupport kHccDrvPerFlashSupport
#define kPerFlashErrorCodePending kHccDrvPerFlashPending
#define kPerFlashErrorCodeFail kHccDrvPerFlashFail
#define kPerFlashErrorCodeIdle kHccDrvPerFlashIdle

#define kPerFlashNandErrorCodeSuccess kHccDrvPerFlashSuccess
#define kPerFlashNandErrorCodeComm kHccDrvPerFlashComm
#define kPerFlashNandErrorCodeParam kHccDrvPerFlashParam
#define kPerFlashNandErrorCodeCallBack kHccDrvPerFlashCallBack
#define kPerFlashNandErrorCodeExist kHccDrvPerFlashExist
#define kPerFlashNandErrorCodeSupport kHccDrvPerFlashSupport
#define kPerFlashNandErrorCodePending kHccDrvPerFlashPending
#define kPerFlashNandErrorCodeFail kHccDrvPerFlashFail
#define kPerFlashNandErrorCodeIdle kHccDrvPerFlashIdle
#define kPerFlashNandErrorCodeTimeOut kHccDrvPerFlashTimeOut
#define kPerFlashNandErrorCodeUnlockFail kHccDrvPerFlashUnlockFail

#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_DRV_PER_FLASH_H_
/**
 * @
 */
